home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / tsql / doc / tsql.mail / 000078_csj@iesd.auc.dk _Thu Apr 8 21:29:00 1993.msg < prev    next >
Internet Message Format  |  1996-01-31  |  20KB

  1. Received: from iesd.auc.dk by optima.cs.arizona.edu (5.65c/15) via SMTP
  2.     id AA15157; Thu, 8 Apr 1993 12:29:43 MST
  3. Received: from yellow.iesd.auc.dk by iesd.auc.dk with SMTP id AA21807
  4.   (5.65c8/IDA-1.5/MD for <tsql@cs.arizona.edu>); Thu, 8 Apr 1993 21:29:00 +0200
  5. Date: Thu, 8 Apr 1993 21:29:00 +0200
  6. From: "Christian S. Jensen" <csj@iesd.auc.dk>
  7. Message-Id: <199304081929.AA21807@iesd.auc.dk>
  8. To: tsql@cs.arizona.edu
  9. Subject: TSQL Benchmark, Task 3.
  10.  
  11. ********************************************************************
  12. *       The TSQL Benchmark Initiative -- Task 3: Taxonomy          *
  13. ********************************************************************
  14.  
  15. Three initial tasks were defined in connection with version 1 of the
  16. TSQL benchmark.
  17.  
  18. Task 1: Decide on a db schema
  19. Task 2: Decide on an instance for the schema
  20. Task 3: Decide on a classification of benchmark queries
  21.  
  22. When these are completed, we still need to enter queries into the
  23. benchmark (Task 4). On the other hand, the deadline is firm--the
  24. benchmark must be finished in time for the TDB Workshop in June.
  25.  
  26. Task 4: Populate the benchmark with queries of each type identified in
  27.         the taxonomy.
  28.  
  29. Task 1 is essentially completed, and we now have a consensus schema
  30. that is well-suited for the benchmark.
  31.  
  32. While discussions are currently being carried out wrt Task 2, we can
  33. also start discussing Task 3. For that purpose, the straw proposal for
  34. a taxonomy of benchmark queries has been completed. This proposal is
  35. appended below.
  36.  
  37. As for the other tasks, comments, improvements, suggestions, etc. are
  38. very welcome.
  39.  
  40. Best regards,
  41. Christian S. Jensen
  42. Aalborg University
  43. csj@iesd.auc.dk
  44.  
  45. \documentstyle[11pt]{article}
  46. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  47. % This document contains what is intended to evolve into the
  48. % consensus taxonomy of benchmark queries for the first version of the
  49. % TSQL Benchmark. It addresses Task 3 of the initial tasks and should
  50. % be appended, as an individual section to the document ``The TSQL
  51. % Benchmark.''
  52. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  53. \addtolength{\textwidth}{1.485in}%{1.2in}
  54. \setlength{\oddsidemargin}{.1in}%{.3in}
  55. \setlength{\evensidemargin}{.1in}%{.3in}
  56. \addtolength{\topmargin}{-.85in} %{-1.35in}
  57. \addtolength{\textheight}{1.8in} %{2.8in}
  58.  
  59. \long\def\comment#1{}
  60.  
  61. \newenvironment{BNF}{\vspace{-\partopsep}\addtolength{\baselineskip}{+4pt}
  62. \samepage\begin{tabbing}
  63. %\quad
  64. \ \ \ \ \=\ \ \ \ \=\ \ \ \ \=\ \ \ \ \=\ \ \ \ \=\ \ \ \ \=\ \ \ \ \=\ \ \ \ \=
  65. \+\kill}{\end{tabbing}\vspace{-\partopsep}\vspace{-\topsep}\vspace{-\parsep}}
  66.  
  67. % => in roman
  68. \def\arrow{\char'75\char'76\relax}
  69. % ::= in roman
  70. \def\is{{\rm \verb.:.\verb.:.\char'75\relax}}
  71. % { in roman
  72. \def\lbr{$\bigl\{$}
  73. % } in roman
  74. \def\rbr{$\bigr\}\;$}
  75. % }* in roman
  76. \def\starbr{$\bigl\}${\rm *}$\;$}
  77. % }? in roman
  78. \def\quesbr{$\bigr\}{}^?$}
  79. % }+ in roman
  80. \def\plusbr{$\bigr\}{}^+$}
  81. % | in roman
  82. \def\vbar{$\bigl|\;$}
  83. % 'chars 
  84. \def\qt#1{`{#1}'}
  85. % nonterminals (arg is the name)
  86. \def\nt#1{$<${\rm #1}$>$}
  87. %typerwriter font
  88. \def\ttt#1{{\tt #1}}
  89. %comment
  90. \def\com#1{{\tt /$\ast$} {\footnotesize #1}}
  91.  
  92. %double square brackets
  93. \def\dsl{{\tt [\hspace{-4.5pt}[ \hspace{-1pt}}}
  94. \def\dsr{{\tt ]\hspace{-4.5pt}]}}
  95. \def\dsrs{{\tt ]\hspace{-4.5pt}]\hspace{4pt}}}
  96.  
  97. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  98. % PAPER START
  99. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  100.  
  101. \begin{document}
  102.  
  103. \title{\Large\bf The TSQL Benchmark \\ Taxonomy DRAFT}
  104. \author{}
  105. \date{April 8, 1993}
  106. \maketitle
  107.  
  108. \section{Classification of Benchmark Queries}
  109.  
  110. A classification of benchmark queries will be based on a comprehensive
  111. taxonomy of queries. First, critria for such a taxonomy are outlined.
  112. Next, the taxonomy itself is presented. As the taxonomy is too
  113. fine-grained, categories are then merged into an adequate number of
  114. groups which can subsequently be used for classification.
  115.  
  116. \subsection{Criteria}
  117.  
  118. Three criteria for an appropriate taxonomy of benchmark queries are
  119. suggested.
  120. \begin{itemize}
  121. \item{} The taxonomy should be schema and instance independent. This
  122.   criterion helps ensure that the taxonomy will persist when the
  123.   benchmark database schema evolves as new versions appear. Ideally,
  124.   this will allow for an incremental mode of work, where only new
  125.   queries need to be categorized and existing queries do not need
  126.   re-categorization.
  127. \item{} The taxonomy should provide comprehensive coverage of
  128.   benchmark queries. Comprehensiveness is desirable to avoid holes and
  129.   point to many categories of queries.
  130. \item{} The taxonomy should be useful when structuring the
  131.   presentation of benchmark queries. Most importantly, it should
  132.   provide sufficient structure. Thus, taxonomies that have only few
  133.   categories and that map many queries to single categories are
  134.   problematic. If the number of categories is excessive for
  135.   presentation purposes, classes of categories may be identified with
  136.   individual sections.
  137. \end{itemize}
  138.  
  139. \subsection{The Taxonomy}
  140.  
  141. The taxonomy is characterized as having a projection (output) and a
  142. selection component, much like SQL. Then each component is covered in
  143. turn. Finally, the full taxonomy is summarized and a notation for
  144. naming individual categories is defined.
  145.  
  146. \subsubsection{Top-level Taxonomy}
  147.  
  148. At the top level, the taxonomy is divided into two orthogonal parts,
  149. namely a part where queries are categorized according to their {\em
  150.   output component} and a part where the categorization is based on
  151. the {\em selection component}. Thus, a category is described by two
  152. components, as illustrated in Figure~\ref{fig:top}.
  153.  
  154. \begin{figure}[htbp]
  155.   \[
  156.     \{ <\mbox{output component}> \}
  157.     \times 
  158.     \{ <\mbox{selection component}> \}
  159.   \]
  160.   \caption{Top-level Description of Benchmark Taxonomy}
  161.   \label{fig:top}
  162. \end{figure}
  163.  
  164. This top-level design reflects the SQL template (i.e., {\tt SELECT}
  165. \ldots {\tt FROM} \ldots {\tt WHERE} \ldots). The first component
  166. categorizes the contents of the {\tt SELECT} clause, and the second
  167. component categorizes the contents of the {\tt WHERE} clause. No
  168. component is needed to reflect the {\tt FROM} clause where tuple
  169. variables are defined. The two components are orthogonal only in the
  170. same sense that the {\tt WHERE} and {\tt SELECT} clauses of a
  171. particular query are orthogonal.
  172.  
  173. \subsubsection{Output-based Taxonomy}
  174.  
  175. The output-based taxonomy is intended to reflect the part of queries
  176. where the format of the resulting tuples is specified. The taxonomy is
  177. described in Figure~\ref{fig:pro1} and is explained in the following.
  178.  
  179. \begin{figure}[htbp]
  180. \begin{center}
  181.   \leavevmode
  182.     \[
  183.       \left\{ \begin{array}{c}
  184.         \mbox{\underline{explicit-attribute component}} \\
  185.         \mbox{none} \\
  186.         \mbox{projected} \\
  187.         \mbox{complete}
  188.       \end{array} \right\}
  189.       \times
  190.       \left\{ \begin{array}{c}
  191.         \mbox{\underline{valid-time component}} \\
  192.         \mbox{none} \\
  193.         \left\{ \begin{array}{c}
  194.           \mbox{\underline{type}} \\
  195.           \mbox{event} \\
  196.           \mbox{interval} \\
  197.           \mbox{element}
  198.         \end{array} \right\}
  199.         \times
  200.         \left\{ \begin{array}{c}
  201.           \mbox{\underline{value}} \\
  202.           \mbox{derived} \\
  203.           \mbox{imposed}
  204.         \end{array} \right\}
  205.       \end{array} \right\}
  206.     \]
  207. \end{center}
  208. \caption{Output-based Taxonomy}
  209. \label{fig:pro1}
  210. \end{figure}                                                         
  211.  
  212. The idea is to distinguish between queries based on the format of the
  213. result tuples. A tuple may include an explicit-attribute component and
  214. a valid-time component, each of which are considered next.
  215.  
  216. If present, the explicit-attribute component, may contain all
  217. attributes in the argument relation (multiple relations are discussed
  218. below) or it may contain a subset of the attributes in the argument
  219. relation. In the first case, the explicit attribute component is
  220. ``complete,'' and in the second, it is ``projected.''
  221.  
  222. To exemplify, consider a tuple telling that Ed is in the Book
  223. department from 1/1/82 to 12/31/84. Here ``Ed'' and ``Book''
  224. constitute the explicit-attribute component, and ``1/1/82'' and
  225. ``12/31/84'' is the valid-time component. If the argument relation
  226. contained an attribute ``Salary'' in addition to the Name and
  227. Department attributes, this result is projected.
  228.  
  229. If several relations are used in a query, the argument relation is the
  230. Cartesian product of these, i.e., the schema is the concatenation of
  231. the schemas of the relations used in the query.
  232.  
  233. The valid-time component of a tuple may be of three types. First, it
  234. may be an event, i.e., a single time value (e.g., 3/1/83). Second, it
  235. may be an interval, i.e., a sequence of consecutive time values (e.g.,
  236. as above). Third, it may be an element, i.e., a set of time values
  237. which may be described by a set of intervals (e.g., 1/1/82 to
  238. 12/31/84, 2/1/85 to 3/31/85, and 5/1/86 to 5/31/86).
  239.  
  240. Orthogonally, the value of a valid-time component may be derived or
  241. imposed. A derived value is computed solely in terms of the valid-time
  242. components of the tuples in the argument relation. An imposed value is
  243. computed by explicit assignment in the query.
  244.  
  245. Note that at least one of the two components must be present in the
  246. result of a query. This part of the taxonomy results in 20 mutually
  247. exclusive categories.
  248.  
  249. The distinctions above are based on the schema of result relations. It
  250. is possible also to distinguish between the cardinalities of result
  251. relations, e.g., between set-valued and single-tuple valued results.
  252.  
  253. \subsubsection{Selection-based Taxonomy}
  254.  
  255. The selection component is divided into two parts, one for valid-time
  256. selection and one for selection not involving valid time. See
  257. Figure~\ref{fig:selt}.
  258.  
  259. \begin{figure}[htbp]
  260.   \[
  261.     \{ <\mbox{valid-time selection}> \}^\ast
  262.     \times 
  263.     \{ <\mbox{non-temporal selection}> \}^\ast
  264.   \] 
  265.   \caption{Top-level Selection-based Taxonomy}
  266.   \label{fig:selt}
  267. \end{figure}
  268.  
  269. Both parts are based on the same observation. In general, a selection
  270. predicate is built from atomic selection predicates using logical
  271. operators (e.g., {\tt and}, {\tt or}, and {\tt implies}) and
  272. parenthesis. Both parts categorize queries based on the atomic
  273. predicates used in the queries. As several types of atomic predicates
  274. may be used in the same query, queries generally fall into multiple
  275. categories (as indicated in Figure~\ref{fig:selt} by the Kleene star,
  276. ``${}^\ast$''). We examine each part of the selection-based taxonomy
  277. in turn.
  278.  
  279. Atomic valid-time selection predicates are assumed to be of the form
  280. \[ arg_1 \mbox{\tt ~op~} arg_2 \hspace*{2mm},\]
  281. where {\tt op} is a some comparison operator (e.g., {\tt precedes}, and
  282. {\tt contains}). It is assumed that $arg_1$ is the valid time of the
  283. data, and restrictions are imposed based on the type of the comparison
  284. operator, on the origin of $arg_2$, and on the type of $arg_2$.
  285. Figure~\ref{fig:sel2} outlines the categories.
  286.  
  287. \begin{figure}[htbp]
  288.   \begin{center}
  289.     \leavevmode
  290.       \[
  291.         \left\{ \begin{array}{c}
  292.           \mbox{\underline{type of comparison operator}} \\
  293.           \mbox{duration-based} \\
  294.           \mbox{ordering-based} \\
  295.           \mbox{containment-based}
  296.         \end{array} \right\}
  297.         \times
  298.         \left\{ \begin{array}{c}
  299.           \mbox{\underline{type of $arg_2$}} \\
  300.           \mbox{event} \\
  301.           \mbox{interval} \\
  302.           \mbox{element}
  303.         \end{array} \right\}
  304.         \times
  305.         \left\{ \begin{array}{c}
  306.           \mbox{\underline{origin of $arg_2$}} \\
  307.           \mbox{explicitly supplied in query} \\
  308.           \mbox{user-defined attribute value} \\
  309.           \mbox{computed from other valid times}
  310.         \end{array} \right\}
  311.       \]
  312.   \end{center}
  313.   \caption{Valid-time Selection-based Taxonomy}
  314.   \label{fig:sel2}
  315. \end{figure}
  316.  
  317. Three types of comparison operators are identified. First, a
  318. comparison operator may be duration-based. For example the operator
  319. {\tt spanExceeds} returns true if the duration of the first argument
  320. is equal to or larger than the duration of the second argument.
  321. Second, comparison operators may be based on ordering. Operators in
  322. this category include {\tt precedes} and {\tt meets}. The first
  323. applies to all timestamps and evalutes to true if the largest time in
  324. the first argument is smaller than the smallest times in the second
  325. argument. Operator {\tt meets} appears to be useful only for events
  326. and intervals. Two timestamps meet if they are not separated by any
  327. event (i.e., may be coalesced). Operators based on containment include
  328. {\tt =} (identity), {\tt overlaps}, and {\tt contains}.
  329.  
  330. The second argument ($arg_2$) may be an event, an interval, or an
  331. element. Also, it may come from three sources. First, it may be
  332. supplied directly in the query, as a constant. Second, it may be the
  333. value of a user-defined time attribute in an argument tuple. Note that
  334. this is only possible for events if first normal form is required.
  335. Third, like the first argument, the second argument may be computed
  336. from valid times in the argument tuples.
  337.  
  338. If the three types of categories are completely orthogonal, this
  339. part of the taxonomy will contribute with a total of 27 categories.
  340. However, it may be debated whether intervals and elements may be used
  341. as values of user-defined attributes (resulting in non-1NF relations).
  342.  
  343. The final part of the selection-based taxonomy categorizes queries
  344. based solely on the part of the selection component that involves only
  345. ordinary, non-temporal selection.
  346.  
  347. Many possibilities for categorization exist. Below, in
  348. Figure~\ref{fig:sel1}, we distinguish between four significant types
  349. of atomic selection predicates. First, an attribute may be compared
  350. with a constant, supplied by the user. Second, attribute values, both
  351. in the same relation, may be compared. Third, a primary key value may
  352. be compared with a matching foreign key value. Fourth, arbitrary
  353. attributes of possibly distinct relations may be compared. In the
  354. figure, $\theta ::= \; < | > | \leq | \geq | = \;$, i.e., a
  355. combination of equality and/or the one of the two inequality
  356. operators. If we distinguish between situations where only equality is
  357. involved and situations where inequality is involved, this give 8
  358. categories.
  359.  
  360. \begin{figure}[htbp]
  361.   \begin{center}
  362.     \leavevmode
  363.       \[
  364.         \left\{ \begin{array}{c}
  365.           \mbox{\underline{non-temporal attribute value selection}} \\
  366.           att~\theta~\mbox{\em Constant} \\
  367.           att_1~\theta~att_2 \\
  368.           att_k~\theta~att_{fk} \\
  369.           att(rel_1)~\theta~att(rel_2)
  370.         \end{array} \right\}
  371.         \times
  372.         \left\{ \begin{array}{c}
  373.           \mbox{\underline{comparison operator, $\theta$}} \\
  374.           \mbox{only equality } (=) \\
  375.           \mbox{inequality } (<>)
  376.         \end{array} \right\}
  377.       \]
  378.   \end{center}
  379.   \caption{Non-temporal Selection-based Taxonomy}
  380.   \label{fig:sel1}
  381. \end{figure}
  382.  
  383. \subsubsection{Additional Contributions---TEMPORARY}
  384.  
  385. The distinction between grouped and ungrouped queries has not been
  386. integrated into the taxonomy. To do that, definitions of these
  387. categories are needed.
  388.  
  389. \subsection{Overview and Naming of Categories}
  390.  
  391. Each query has a single output component, zero or more valid-time
  392. selection components (one per such operator), and zero or more
  393. non-temporal selection-based components (one per such operator). The
  394. taxonomy is summarized in Figure~\ref{fig:tax}. There, the names
  395. introduced in the taxonomy are used along with punctuation in order to
  396. name a category.
  397.  
  398. \begin{figure}[htbp]
  399. \begin{BNF}
  400. \nt{non-t selection} \=\is\ \= \kill
  401. \nt{category} \> \is \> \nt{output} \qt{/} \lbr \nt{v-t selection}
  402. \starbr \qt{/} \lbr \nt{non-t selection} \starbr \\
  403. \nt{output} \> \is \> \qt{(} \= \lbr None \vbar Projected \vbar
  404. Complete \rbr \qt{,} \` \com{explicit-attribute component} \\
  405. \>\>\> \lbr \= None \vbar \` \com{no valid-time attribute} \\
  406. \>\>\>\> \lbr Event \vbar Interval \vbar Element \rbr \qt{,} \`
  407. \com{type of valid-time attribute} \\
  408. \>\>\>\> \lbr Derived \vbar Imposed \rbr \rbr \qt{)} \` \com{value of
  409. valid-time attribute} \\
  410. \nt{v-t selection} \> \is \> \qt{(} \lbr Duration \vbar Ordering \vbar
  411. Containment \rbr \qt{,} \` \com{operator type}\\
  412. \>\>\> \lbr Event \vbar Interval \vbar Element \rbr \qt{,} \`
  413. \com{argument type} \\
  414. \>\>\> \lbr Explicit \vbar User-defined \vbar Computed \rbr \qt{)} \`
  415. \com{argument origin} \\
  416. \nt{non-t selection} \> \is \> \qt{(} \lbr \qt{=} \vbar \qt{$<>$} \rbr
  417. \qt{,} \` \com{operator type} \\
  418. \>\>\> \lbr Constant \vbar Single \vbar Foreign \vbar Arbitrary \rbr
  419. \qt{)} \` \com{argument types} \\
  420. \end{BNF}
  421.   \caption{Overview of the Taxonomy used for Naming Categories}
  422.   \label{fig:tax}
  423. \end{figure}
  424.  
  425. To exemplify the use of Figure~\ref{fig:tax} for naming categories,
  426. consider the query ``When was Ed Manager of the Toy Department.''
  427. This query is in the category shown next (with no valid-time
  428. selection).
  429.  
  430. \begin{center}
  431.   (None, Element, Derived) // (=, Constant)
  432. \end{center}
  433.  
  434. It may be observed that the taxonomy gives rise to a large number of
  435. categories. For example, assuming a single non-temporal operator and no
  436. valid-time operators, there are $20 \times 8 = 160$ categories. Adding
  437. a single valid-time operator while assuming orthogonality yields an
  438. additional 4320 categories!
  439.  
  440. As a result, it becomes necessary to create classes of categories
  441. which then may be used for clasifying the benchmark queries.
  442.  
  443. One approach would be to name a {\em class} of categories of queries,
  444. by simply replacing one or more of the entries with the Kleene star
  445. (``*''), e.g.,
  446.  
  447. \begin{center}
  448. (None, Element, Derived) / (*,*,*) / (=, Constant)
  449. \end{center}
  450.  
  451. The above query category would be in this class. In the next section,
  452. we define the classes to be used in the benchmark.
  453.  
  454. \subsection{Forming Classes from Categories}
  455.  
  456. The idea is to remove distinctions from the comprehensive taxonomy
  457. until a suitable number of classes is obtained. Figure~\ref{fig:tax2}
  458. is thus a reduced version of Figure~\ref{fig:tax}.
  459.  
  460. \begin{figure}[htbp]
  461. \begin{BNF}
  462. \nt{reduced v-t selection} \=\is\ \= \kill
  463. \nt{class-name} \> \is \> \nt{reduced output} \qt{/} \lbr
  464. \nt{reduced v-t selection} \starbr \\
  465. \nt{reduced output} \> \is \> \qt{(} \= \lbr None \vbar Proj/Comp
  466. \rbr \qt{,} \` \com{explicit-attribute component} \\
  467. \>\>\> \lbr None \vbar Not empty \rbr \qt{)} \qt{/} \` \com{valid-time
  468.   attribute component} \\
  469. \nt{reduced v-t selection} \> \is \> \qt{(} \> \lbr Duration
  470. \vbar Other \rbr \qt{,} \` \com{comparison operator type} \\
  471. \>\>\> \lbr Event \vbar Interval \vbar Element \rbr \qt{,} \`
  472. \com{argument type} \\
  473. \>\>\> \lbr Computed \vbar Other \rbr \qt{)} \`
  474. \com{argument origin} 
  475. \end{BNF}
  476.   \caption{Overview of the Classification of Queries}
  477.   \label{fig:tax2}
  478. \end{figure}
  479.  
  480. The second and third lines concern output. Only the prescence or
  481. absence of explicit attributes and timestamps are distinguished,
  482. leading to three categories. The last three lines concern valid-time
  483. selection (non-temporal selection is disregarded). Comparison
  484. operators may be duration-based or not; arguments be of either event,
  485. interval, or element type; and the arguments may or may not derive
  486. from valid times of tuples.
  487.  
  488. \end{document}